package com.gxxd.model;
/*
 * 黄苗苗44
 */
public class Student {
	private String studentNo;
    private String studentName;
    private String studentSex;
    private int studentAge;
    private Subject subject;
    public  Subject getSubject() {
    	if(subject==null)
    		subject=new Subject();
    	return subject;
    }
    public void setSubject( Subject subject) {
    	this.subject=subject;
    }
    public Student() {
    }
    public Student(String studentNo,String studentName,String studentSex,int studentAge) {
    	this.setStudentNo(studentNo);
    	this.setStudentName(studentName);
    	this.setStudentSex(studentSex);
    	this.setStudentAge(studentAge);
    }
    public Student(String studentNo,String studentName,String studentSex,int studentAge,Subject subject) {
    	this.setStudentNo(studentNo);
    	this.setStudentName(studentName);
    	this.setStudentSex(studentSex);
    	this.setStudentAge(studentAge);
    	this.setSubject(subject);
    }
	public String getStudentNo() {
		return studentNo;
	}
	public void setStudentNo(String studentNo) {
		this.studentNo = studentNo;
	}
	public String getStudentName() {
		return studentName;
	}
	public void setStudentName(String studentName) {
		this.studentName = studentName;
	}
	public String getStudentSex() {
		return studentSex;
	}
	public void setStudentSex(String studentSex) {
		if(studentSex=="  "||studentSex=="Ů")
		this.studentSex = studentSex;
		else
			return;
	}
	public int getStudentAge() {
		return studentAge;
	}
	public void setStudentAge(int studentAge) {
		if(studentAge<=0||studentAge>100)
			studentAge=18;
		this.studentAge = studentAge;
	}
   public String studentInfo(String subjectName,int subjectTime) {
	   String ref="学生详细信息:\n学生姓名:"+this.getStudentName()+"\n学生学号:"+this.getStudentNo()+"\n学生年龄:"+this.getStudentAge()
	   +"\n学生性别:"+this.getStudentSex()+"\n所学专业名称:"+subjectName+"\n学制年限:"+subjectTime;
		return ref;
    }
   public String studentInfo(Subject subject) {
	   String ref="学生详细信息:\n学生姓名:"+this.getStudentName()+"\n学生学号:"+this.getStudentNo()+"\n学生年龄:"+this.getStudentAge()
	   +"\n学生性别:"+this.getStudentSex()+"\n所学专业名称:"+subject.getSubjectName()+"\n学制年限:"+subject.getSubjectName();
		return ref;
   }
   public String studentInfo() {
	   String ref="学生详细信息:\n学生姓名:"+this.getStudentName()+"\nn学生学号:"+this.getStudentNo()+"\n学生年龄:"+this.getStudentAge()
	   +"\n学生性别:"+this.getStudentSex()+"\n所学专业名称:"+this.getSubject().getSubjectName()+"\n学制年限:"+this.getSubject().getSubjectName();
		return ref;
   }
}
